package com.newviews.tcmip.web.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.newviews.tcmip.common.constant.CommonConsts;
import com.newviews.tcmip.common.model.ResultModel;
import com.newviews.tcmip.pojo.po.EtcmTargetTypePo;
import com.newviews.tcmip.service.inf.EtcmTargetTypeServiceInf;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 字典-靶向信息分类 前端控制器
 * </p>
 *
 * @author lxc
 * @since 2024-03-14
 */
@RestController
@RequestMapping("/etcm/targetType")
@Api(tags = "靶向信息类型")
public class EtcmTargetTypeController {
    @Autowired
    private EtcmTargetTypeServiceInf etcmTargetTypeService;

    @GetMapping("/list")
    @ApiOperation("获取靶向信息类型信息")
    public ResultModel<List<EtcmTargetTypePo>> getList(@RequestParam String langCode){
        List<EtcmTargetTypePo> list = etcmTargetTypeService.list(new QueryWrapper<EtcmTargetTypePo>().eq(EtcmTargetTypePo.LANGUAGE_CODE, langCode).eq(EtcmTargetTypePo.STATUS, CommonConsts.STR_COMMON_YES).orderByAsc(EtcmTargetTypePo.TYPE_SORT));
        return new ResultModel<List<EtcmTargetTypePo>>().success(list);
    }
}
